import java.util.Scanner;

/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2214 2215
 * @Package: PACKAGE_NAME
 * @File: ScoreLevel.java
 * @Time: 2022/11/29 10:13
 * @Author: abcque
 * @Description: 将百分制成绩转换为五级制成绩
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */

/*假设用户输入的成绩的范围是[0,100]，将输入的百分制成绩转换成等级输出，转换的规则如下：
[90,100]      A
[80,89]       B
[70,79]       C
[60,69]       D
[0,59]        F
*/
public class ScoreLevel {
    public static void main(String[] args) {
        // step1、定义成绩变量 score
        int score;
        // step2、通过控制台输入成绩
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入要转换的百分制成绩：");
        score = scanner.nextInt();

        // step3、根据转换规则，转成五级制成绩
        if ((90 <= score) && (score <= 100)) {
            System.out.println("百分制成绩 " + score + " 对应的五级制等级是：A");
        } else {
            if ((80 <= score) && (score <= 89)) {
                System.out.println("百分制成绩 " + score + " 对应的五级制等级是：B");
            } else {
                if ((70 <= score) && (score <= 79)) {
                    System.out.println("百分制成绩 " + score + " 对应的五级制等级是：C");
                } else {
                    if ((60 <= score) && (score <= 69)) {
                        System.out.println("百分制成绩 " + score + " 对应的五级制等级是：D");
                    } else {
                        if ((0 <= score) && (score <= 59)) {
                            System.out.println("百分制成绩 " + score + " 对应的五级制等级是：F");
                        }
                    }
                }
            }
        }
    }
}
